﻿<MenuItem x:Class="IBTrader.Frontend.Log.Menu" Header="Log"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:con="http://schemas.kent.boogaart.com/converters"
            xmlns:nlog="clr-namespace:NLog;assembly=NLog"
            xmlns:sys="clr-namespace:System;assembly=mscorlib"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <MenuItem Header="Clear" Command="{Binding Clear}"/>
    <Separator/>
    <MenuItem Header="Log Level Info" IsCheckable="True" Command="{Binding ChangeLogLevel}" CommandParameter="Info">
        <MenuItem.IsChecked>
            <Binding Path="LogLevel">
                <Binding.Converter>
                    <con:MapConverter>
                        <con:Mapping From="Info">
                            <con:Mapping.To>
                                <sys:Boolean>True</sys:Boolean>
                            </con:Mapping.To>
                        </con:Mapping>
                    </con:MapConverter>
                </Binding.Converter>
            </Binding>
        </MenuItem.IsChecked>
    </MenuItem>
    <MenuItem Header="Log Level Debug" IsCheckable="True" Command="{Binding SetLogLevel}" CommandParameter="Debug">
        <MenuItem.IsChecked>
            <Binding Path="LogLevel">
                <Binding.Converter>
                    <con:MapConverter>
                        <con:Mapping From="Debug">
                            <con:Mapping.To>
                                <sys:Boolean>True</sys:Boolean>
                            </con:Mapping.To>
                        </con:Mapping>
                    </con:MapConverter>
                </Binding.Converter>
            </Binding>
        </MenuItem.IsChecked>
    </MenuItem>
    <MenuItem Header="Log Level Trace" IsCheckable="True" Command="{Binding SetLogLevel}" CommandParameter="Trace">
        <MenuItem.IsChecked>
            <Binding Path="LogLevel">
                <Binding.Converter>
                    <con:MapConverter>
                        <con:Mapping From="Trace">
                            <con:Mapping.To>
                                <sys:Boolean>True</sys:Boolean>
                            </con:Mapping.To>
                        </con:Mapping>
                    </con:MapConverter>
                </Binding.Converter>
            </Binding>
        </MenuItem.IsChecked>
    </MenuItem>
</MenuItem>
